import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '../views/main/index.vue'
import LOGIN from '../views/login/index.vue'
import Brand from '../views/brand/index.vue'
import SellOrderManage from '../views/sell/sellOrderManage.vue'
import SellOrderDetail from '../views/sell/sellOrderDetail.vue'
import SellOutRepository from '../views/sell/sellOutRepository.vue'
import SellOutRepositoryDetail from "../views/sell/sellOutRepositoryDetail.vue";
import SellOutRepositoryRecord from '../views/sell/sellOutRepositoryRecord.vue'
import SellOutRepositoryRecordDetail from '../views/sell/sellOutRepositoryRecordDetail.vue'
import SellReturnOrder from '../views/sell/sellReturnOrder.vue'
import SellReturnDetail from '../views/sell/sellReturnDetail.vue'
import SellReturnOrderDetail from '../views/sell/sellReturnOrderDetail.vue'
import SellReturnOrderRecord from '../views/sell/sellReturnOrderRecord.vue'
import SellReturnOrderRecordDetail from '../views/sell/sellReturnOrderRecordDetail.vue'
import GiftInfo from '../views/gift/giftInfo.vue'
import GiftToGood from '../views/gift/giftToGood.vue'
import GoodToGift from '../views/gift/goodToGift.vue'
import GiftToGoodCheck from '../views/gift/giftToGoodCheck.vue'
import GoodToGiftCheck from '../views/gift/goodToGiftCheck.vue'
import GiftBind from '../views/gift/giftBind.vue'
import Refacoutman from '../views/aftersale/refacoutman/index.vue'
import OutApplyInfo from '../views/aftersale/outapplyinfo/index.vue'
import OutApplyApprove from '../views/aftersale/outapplyapprove/index.vue'
import Refacinman from '../views/aftersale/refacinman/index.vue'
import InApplyInfo from '../views/aftersale/inapplyinfo/index.vue'
import InApplyApprove from '../views/aftersale/inapplyapprove/index.vue';
import notfound from "../views/main/notfound.vue";
import productquery from "../views/goods/productquery.vue";
import goodsmanage from "../views/goods/goodsmanage.vue";
import goodbrand from "../views/goods/goodbrand.vue";
import goodtype from "../views/goods/goodtype.vue";
import supplier from "../views/goods/supplier.vue";
import priceadjust from "../views/goods/priceadjust.vue";
// Vue.use(VueRouter)
import B2cReturnsApply from '../views/b2cReturns/find/apply.vue';
import B2cReturnsApplyApproval from '../views/b2cReturns/approval/approval.vue';
import Loading from "element-ui/packages/loading/src";
import B2cReturnsApplyComplaint from '../views/b2cReturns/complaint/complaint.vue';
import RepOutAfterSale from '../views/repository/out/aftersale/index.vue';
import OutRepo from '../views/repository/out/outRepo/index.vue'
import RepoOutApprove from '../views/repository/approve/out/index.vue'
import RepInAfterSale from '../views/repository/in/aftersale/index.vue';
import Repair from '../views/aftersale/repair/index.vue'





Vue.use(VueRouter);

const originalPush = VueRouter.prototype.push;

VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
};



// import ReturnedAudit from "../views/marketingActivity/Returned/ReturnedAudit.vue";


const routes = [
    // {
    //   path: '/',
    //   name: 'Home',
    //   component: Home
    // },
    // {
    //   path: '/about',
    //   name: 'About',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
    // }

    {
        path: '/',
        name: 'Main',
        component: Main,
        children: [
            {
                path: '/priceadjust',
                name: 'priceadjust',
                component: priceadjust
            },
            {
                path: '/goodbrand',
                name: 'goodbrand',
                component: goodbrand
            }
            ,
            {
                path: '/supplier',
                name: 'supplier',
                component: supplier
            }
            ,
            {
                path: '/goodtype',
                name: 'goodtype',
                component: goodtype
            },
            {
                path: '/goodsmanage',
                name: 'goodsmanage',
                component: goodsmanage
            }
            , {
                path: '/productquery',
                name: 'productquery',
                component: productquery
            },
            {
                path: '/brand',
                name: 'Brand',
                component: Brand
            },
            {
                path: '/giftInfo',
                name: 'GiftInfo',
                component: GiftInfo
            },
            {
                path: '/giftToGoodCheck',
                name: 'GiftToGoodCheck',
                component: GiftToGoodCheck
            },
            {
                path: '/goodToGiftCheck',
                name: 'goodToGiftCheck',
                component: GoodToGiftCheck
            },
            {
                path: '/giftToGood',
                name: 'GiftToGood',
                component: GiftToGood
            },
            //返厂出库管理
            {
                path: '/goodToGift',
                name: 'GoodToGift',
                component: GoodToGift
            },
            {
                path: '/giftBind',
                name: 'GiftBind',
                component: GiftBind
            },
            {
                path: '/refacoutman',
                name: 'Refacoutman',
                component: Refacoutman
            },
            //返厂出库单详情
            {
                path: '/outApplyInfo',
                name: 'outApplyInfo',
                component: OutApplyInfo
            },
            //返厂入库审批
            {
                path: '/OutApplyApprove',
                name: 'OutApplyApprove',
                component: OutApplyApprove
            },
            //返厂入库管理
            {
                path: '/refacinman',
                name: 'Refacinman',
                component: Refacinman
            },
            //返厂入库单详情
            {
                path: '/inApplyInfo',
                name: 'inApplyInfo',
                component: InApplyInfo,
                children: [{
                    path: '/son',
                    name: 'sonOutApplyInfo',
                    component: OutApplyInfo
                }]
            },
            //返厂入库审批
            {
                path: '/inApplyApprove',
                name: 'inApplyApprove',
                component: InApplyApprove
            },
            //维修点管理
            {
                path: '/repair',
                name: 'repair',
                component: Repair
            },
            {
                path: '/b2cApply',
                name: 'B2cReturnsApply',
                component: B2cReturnsApply
            },
            {
                path: '/b2cApplyApproval',
                name: 'B2cReturnsApplyApproval',
                component: B2cReturnsApplyApproval
            },
            {
                path: '/sellOrderManage',
                name: 'SellOrderManage',
                component: SellOrderManage
            },
            {
                path: '/sellOrderDetail/:sellCode',
                name: 'SellOrderDetail',
                component: SellOrderDetail
            },
            {
                path: '/sellOutRepository',
                name: 'sellOutRepository',
                component: SellOutRepository
            },
            {
                path: '/sellOutRepositoryDetail/:sellCode',
                name: 'sellOutRepositoryDetail',
                component: SellOutRepositoryDetail
            },
            {
                path: '/sellOutRepositoryRecord',
                name: 'sellOutRepositoryRecord',
                component: SellOutRepositoryRecord
            },
            {
                path: '/sellOutRepositoryRecordDetail',
                name: 'sellOutRepositoryRecordDetail',
                component: SellOutRepositoryRecordDetail
            },{
                path: '/sellReturnOrder',
                name: 'sellReturnOrder',
                component: SellReturnOrder
            },{
                path: '/sellReturnDetail/:sellCode',
                name: 'sellReturnDetail',
                component: SellReturnDetail
            },{
                path: '/sellReturnOrderDetail/:sellCode',
                name: 'sellReturnOrderDetail',
                component: SellReturnOrderDetail
            },{
                path: '/sellReturnOrderRecord',
                name: 'sellReturnOrderRecord',
                component: SellReturnOrderRecord
            },{
                path: '/sellReturnOrderRecordDetail',
                name: 'sellReturnOrderRecordDetail',
                component: SellReturnOrderRecordDetail
            },

            //库存管理——返厂出库管理
            {
                path: '/repOutAfterSale',
                name: 'repOutAfterSale',
                component: RepOutAfterSale,
            },
            //库存管理——出库单
            {
                path: '/outRepo',
                name: '0utRepo',
                component: OutRepo
            },
            //库存管理——返厂入库管理
            {
                path: '/repInAfterSale',
                name: 'repInAfterSale',
                component: RepInAfterSale
            },
            //库存管理——出库审核
            {
                path: '/repoOutApprove',
                name: 'repoOutApprove',
                component: RepoOutApprove
            },
            {
                path: '/b2cApplyComplaint',
                name: 'B2cReturnsApplyComplaint',
                component: B2cReturnsApplyComplaint
            },
            // {
            //     path: '/Promotion/',
            //     name: '/Promotion',
            //     component: Promotion
            // },
            // {
            //     path: '/PromotionApply',
            //     name: '/PromotionApply',
            //     component: PromotionApply
            // },
            // {
            //     path: '/PromotionApply2/:goodId',
            //     name: '/PromotionApply2',
            //     component: PromotionApply2
            // },
            // {
            //     path: '/PromotionApplyUpdate/:promotionId',
            //     name: '/PromotionApplyUpdate',
            //     component: PromotionApplyUpdate
            // },
            // {
            //     path: '/PromotionApplyLook/:promotionId',
            //     name: '/PromotionApplyLook',
            //     component: PromotionApplyLook
            // },
            // {
            //     path: '/Marketing',
            //     name: '/Marketing',
            //     component: Marketing
            // },
            // {
            //     path: '/gift',
            //     name: '/gift',
            //     component: gift
            // },
            // {
            //     path: '/MarketingApply',
            //     name: '/MarketingApply',
            //     component: MarketingApply
            // },{
            //     path: '/MarketingApplyUpdate',
            //     name: '/MarketingApplyUpdate',
            //     component: MarketingApplyUpdate
            // },
            // {
            //     path: '/Returned',
            //     name: '/Returned',
            //     component: Returned,
            // },
            // {
            //     path: '/ReturnedApply',
            //     name: '/ReturnedApply',
            //     component: ReturnedApply
            // },

        ]
    },
    {
        path: '/login',
        name: 'LOGIN',
        component: LOGIN
    },
    {
        path: '*',
        name: 'notfound',
        component: notfound
    }

];

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
});

export default router
